package cn.zgr.ssm.controller;

import cn.zgr.ssm.entity.ResponseResult;
import cn.zgr.ssm.entity.Student;
import cn.zgr.ssm.entity.StudentVO;
import cn.zgr.ssm.mapper.StudentMapper;
import cn.zgr.ssm.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private IStudentService studentServiceImpl;

    @RequestMapping(value = "/showVOList.do" ,method = RequestMethod.GET)
    @ResponseBody
    public ResponseResult<List<StudentVO>> showStudentVOList(){
        ResponseResult<List<StudentVO>> rr =  new ResponseResult<List<StudentVO>>();
        List<StudentVO> list = studentServiceImpl.showStudentVOList();
        rr.setData(list);
        return rr;
    }

}
